package com.suzhe.ymall.system.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 资源管理
 * </p>
 *
 * @author suzhe
 * @since 2019-06-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="SysResource对象", description="资源管理")
public class SysResource implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "父资源ID，一级资源为0")
    private Integer parentId;

    @ApiModelProperty(value = "资源名称")
    private String name;

    @ApiModelProperty(value = "权限标识")
    private String permission;

    @ApiModelProperty(value = "1：菜单   2：动作（查看 删除 增加等）")
    private Integer type;

    @ApiModelProperty(value = "排序")
    private Integer orderNum;

    @ApiModelProperty(value = "创建者ID")
    @JsonIgnore
    private Integer creater;

    @ApiModelProperty(value = "更新者ID")
    @JsonIgnore
    private Integer updater;

    @ApiModelProperty(value = "更新时间")
    @JsonIgnore
    private Date updateTime;

    @ApiModelProperty(value = "创建时间")
    @JsonIgnore
    private Date createTime;

    @TableField(exist=false)
    private List<SysResource> children;


}
